import url from '@/tool/index.js'
export const sendSMS = (mobile) => { //获取验证
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/sms/send',
			data: {
				mobile:mobile,
				event:'yuyue'
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}

export const checkSMS = (mobile,captcha) => { //检查
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/sms/check',
			data: {
				mobile:mobile,
				captcha:captcha,
				event:'yuyue'
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}

export const updatePwd = (password) => { //教练端修改密码
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.coach/changePswSave',
			data: {
				password:password,
				coachtoken: uni.getStorageSync('teacherToken')
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}